package com.example.client;


import com.example.common.dto.PageDto;
import com.example.common.vo.PageVo;
import com.example.common.vo.Result;
import com.example.entity.dto.CourseDto;
import com.example.entity.vo.CourseVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "course", url = "http://localhost:8082")
public interface CourseClient {

    @GetMapping("/course/{courseId}")
    Result<CourseVo> getCourseById(@PathVariable Integer courseId);

    @PostMapping("/course/")
    Result<Boolean> addCourse(@RequestBody CourseDto courseDto);

    @DeleteMapping("/course/{courseId}")
    Result<Boolean> deleteCourseById(@PathVariable Integer courseId);
    @PutMapping
    Result<Boolean> updateCourse(@RequestBody CourseDto courseDto);

    @PostMapping("/course/page")
    Result<PageVo<CourseVo>> getCoursePage(@RequestBody PageDto<CourseDto> pageDto);

}
